package com.woniuxy.contract.service.serviceimpl;


import com.woniuxy.contract.mapper.ContractMapper;
import com.woniuxy.contract.service.ContractService;
import com.woniuxy.entity.Contract;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ContractServiceImpl implements ContractService {

    @Resource
    ContractMapper contractMapper;

    /*
    添加
     */
    @Override
    public void addContract(Contract contract) {

        contractMapper.addContract(contract);
    }

    /*
    修改
     */
    @Override
    public Contract updateContract(int id_contract) {

        Contract contract = contractMapper.updateContract(id_contract);

        return contract;
    }

    /*
    查询所有合同
     */
    @Override
    public List<Contract> selectAllContract() {


        return contractMapper.selectAllContract();
    }

    /*
    根据id查询
     */
    @Override
    public Contract selectContractById(int id_contract) {

        return contractMapper.selectContractById(id_contract);
    }
}
